package com.karst.webnotes.chapter02
{
	import com.karst.webnotes.chapter02.BasicViewExample;
	import com.karst.webnotes.chapter02.FirstPV3DApp;
	
	import flash.display.Sprite;
	
	public class Chapter02Entry extends Sprite
	{
		public static const SECTION_LIST : Array = [1,2] ;
		
		public function Chapter02Entry()
		{
			super();
//			createView() ;
		}
		
		public function showSection( $section : int = 1 ) : void
		{
			while( numChildren )
				removeChildAt( 0 ) ;
			switch( $section )
			{
				case SECTION_LIST[0] :
					createSection01() ;
					break ;
				case SECTION_LIST[1] :
					createSection02() ;
					break ;
				default :
					break ;
			}
		}

		private var firstPv3D : FirstPV3DApp = null ;
		private function createSection01() : void
		{
			if( firstPv3D == null )
				firstPv3D = new FirstPV3DApp() ;
			addChild( firstPv3D ) ;
		}

		private var basicView : BasicViewExample = null ;
		private function createSection02() : void
		{
			if( basicView == null )
				basicView = new BasicViewExample() ;
			addChild( basicView ) ;
		}
		
		private function createView() : void
		{

		}
	}
}